//
//  Utility.h
//  BaseTdkc
//
//  Created by DavidHuang on 16/7/2.
//  Copyright © 2016年 黄栋炜. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Utility : NSObject
+ (UIWindow *)mainWindow;
+ (void)cornerRadiusToClip:(UIView *)view radius:(float)radius;
//计算文本大小
+ (CGSize)getTextString:(NSString *)text textFont:(UIFont *)textFont frameWidth:(float)width;
+ (NSString *)timeStringWithDate:(NSDate *)date;
+ (NSString *)timeToMinuteStringWithDate:(NSDate *)date;
+ (NSString *)trimWithNull:(id)text;
+ (NSData *)compressImage:(UIImage *)compImage imageLength:(NSInteger)imageLength;

+ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
//根据子文件名获取文件路径
+ (NSString *)documentPathWithSubDocumentName:(NSString *)subDocumentName;

+ (BOOL)isPassword:(NSString *)password;
+ (BOOL)isCNPhoneNumber:(NSString *)CNPhoneNumber;
+ (BOOL)isChinese:(NSString *)chinese;
+ (BOOL)isCodeNumber:(NSString *)codeNumber;
+ (BOOL)isNumber:(NSString *)NumberStr;
+ (BOOL)isEmpty:(NSString *)content;
+ (BOOL)getNetStatus;
+ (BOOL) justEmail:(NSString *)email;
@end
